package cn.initcap.concurrency.concurrency.mq.rabbitmq;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author initcap
 * @date Created in 2018/6/20 AM8:55.
 */
@Component
public class RabbitMqClient {

    private RabbitTemplate rabbitTemplate;

    @Autowired
    public RabbitMqClient(RabbitTemplate rabbitTemplate) {
        this.rabbitTemplate = rabbitTemplate;
    }

    public void send(String message) {
        rabbitTemplate.convertAndSend(QueueConstants.TEST, message);
    }

}
